#include <stdio.h>  
  
int main() {  
    char c;  
    if (scanf("%c", &c));  
    if (c <= 'z' && c >= 'a')  
        printf("%c\n", c - 'a' + 'A');  
    else if (c <= 'Z' && c >= 'A')  
        printf("%c\n", c - 'A' + 'a');  
    else  
        printf("%c\n", c);  
    return 0;  
}  